package com.sky.controller.user;

import com.github.pagehelper.PageHelper;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.OrdersService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Version: 1.0
 * @author: wanglonghui
 * @date: 2025/10/14 20:08
 * @description:
 */

@RestController
@RequestMapping
@Slf4j
@Api(tags = "订单管理")
public class OrderController {

    @Autowired
    private OrdersService ordersService;



    /**
     * 历史订单查询
     *
     * @param page
     * @param pageSize
     * @param status   订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消
     * @return
     */
    @GetMapping("historyOrders")
    public Result<PageResult> selectPageHistoryOrders(int page, int pageSize, Integer status) {
        PageResult pageResult = ordersService.pageQuery4User(page, pageSize, status);
        return Result.success(pageResult);
    }


}
